package org.example.bombermanclient;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.example.bombermanclient.controller.MainController;

import java.io.IOException;

public class BombermanFXApplication extends Application {

    @Override
    public void start(Stage stage) throws IOException {
        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/org/example/bombermanclient/main.fxml"));
        Scene scene = new Scene(fxmlLoader.load());
        stage.setTitle("Bomberman Client");
        stage.setScene(scene);
        stage.show();

        // 获取 Controller
        MainController controller = fxmlLoader.getController();
        controller.bindKeyEvents(scene); // 绑定键盘事件
    }

    public static void main(String[] args) {
        launch();
    }
}
